package com.hanthink.common.enums;

import com.hanthink.common.utils.StringUtils;

import java.util.Arrays;
import java.util.List;

/**
 * 推送类型枚举类
 *
 * @author WangBin
 * @since 2025-10-25
 */
public enum PushType {
    PUSH_TYPE_ONE("1", Arrays.asList("两片杭州隐患-安全环保部")),
    PUSH_TYPE_TWO("2", Arrays.asList("两片杭州隐患-安全环保部", "隐患安全分管审核")),
    PUSH_TYPE_THREE("3", Arrays.asList("隐患安全分管审核")),
    PUSH_TYPE_FOUR("4", Arrays.asList("隐患主要负责人审核")),
    PUSH_TYPE_FIVE("5", Arrays.asList("两片杭州隐患-安全环保部", "隐患安全分管审核", "隐患主要负责人审核")),
    PUSH_TYPE_SIX("6", Arrays.asList("两片杭州隐患-安全环保部", "隐患安全分管审核", "隐患部门负责人")),
    PUSH_TYPE_SEVEN("7", Arrays.asList(""));

    private String type;
    private List<String> value;

    PushType(String type, List<String> value) {
        this.type = type;
        this.value = value;
    }

    public String getType() {
        return type;
    }

    public List<String> getValue() {
        return value;
    }

    public static PushType valueByType(String type) {
        if (StringUtils.isEmpty(type)) {
            return null;
        }
        for (PushType pushTypeEnum : PushType.values()) {
            if (pushTypeEnum.getType().equals(type)) {
                return pushTypeEnum;
            }
        }
        return null;
    }

    public static List<String> getValue(String type) {
        if (StringUtils.isEmpty(type)) {
            return null;
        }
        for (PushType pushTypeEnum : PushType.values()) {
            if (pushTypeEnum.getType().equals(type)) {
                return pushTypeEnum.value;
            }
        }
        return null;
    }
}